package creational.singleton;

/**
 * 懒汉式单例模式：只有在使用时才会创建实例
 * @author Zhang Ziyi
 */
public class SingletonLHan {
    private static SingletonLHan singletonLHan;

    private SingletonLHan() {
    }

    public static SingletonLHan getInstance() {
        if (singletonLHan == null) {
            singletonLHan = new SingletonLHan();
        }
        return singletonLHan;
    }
}
